package com.peter.custom_lib;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;

import androidx.annotation.Nullable;

public class ViewCustom extends View {
    private static final String TAG = ViewCustom.class.getSimpleName();

    public ViewCustom(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);

        // context is a monster that anywhere anytime they can show directily
        TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.test);

        String text = ta.getString(R.styleable.test_testAttr);
        String textAttr = ta.getString(R.styleable.test_text);
        String a = ta.getString(R.styleable.test_str_color);

        Log.e(TAG, "text = " + text + " , textAttr = " + textAttr);
        System.out.println("-----------------------------------------------------------------");
        ta.recycle();
    }
}
